<template>
  <div>
    <nav-bar title="任务详情"></nav-bar>
    <div class="taskDetails maxinBox" v-if="massDetails">
      <van-cell title="任务类型名称:" :value="massDetails.taskName || '--'" />
      <van-cell title="测量类型:" :value="massDetails.taskType || '--'" />
      <van-cell title="测量人:" :value="`${massDetails.userName} (${massDetails.userMobile})` || '--'" />
      <van-cell title="测量时间:" :value="massDetails.measureDate | formatDate('YYYY-MM-DD HH:mm:ss') || '--'" />
      <van-cell class="marginTop5" title="测量部位数量:" :value="`${massDetails.measurePartQty}个` || '--'" />
      <van-cell title="检查分项数量:" :value="`${massDetails.checkPartQty}个` || '--'" />
      <van-cell title="合格率:" :value="`${massDetails.passPercent}%` || '--'" />
      <van-cell title="备注:" :value="massDetails.remark || '--'" />
    </div>
  </div>
</template>

<script>
  import massManageAPI from '../../../../api/workAPI/massManageAPI.js'
  export default {
    data() {
      return {
        id: '',
        massDetails: null
      }
    },
    methods: {
      getMassDetails() {
        massManageAPI.getMassDetails(this.id).then(res => {
          this.massDetails = res
        })
      }
    },
    mounted() {
      this.id = this.$route.params.id
      this.getMassDetails()
    }
  }
</script>
